import java.util.StringTokenizer;

class P11498_39643 {

	public static void main(String[] args) {

		while (true) {
			
			int cases = Integer.parseInt(readLn());
			
			if (cases == 0) break;
			
			StringTokenizer st = new StringTokenizer(readLn());
			
			int bx = Integer.parseInt(st.nextToken());
			int by = Integer.parseInt(st.nextToken());
			
			
			for (int k = 0; k < cases; k++) {
				
				st = new StringTokenizer(readLn());
				
				int x = Integer.parseInt(st.nextToken());
				int y = Integer.parseInt(st.nextToken());
				
				if (x > bx && y > by) System.out.println("NE");
				else if (x > bx && y < by) System.out.println("SE");
				else if (x < bx && y < by) System.out.println("SO");
				else if (x < bx && y > by) System.out.println("NO");
				else if (x == bx || y == by) System.out.println("divisa");
				
			}
			
		}
		
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}

}
